package com.slw.caiji.controller;

import com.slw.caiji.utils.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user")
public class SysLoginController {

    @PostMapping("/info")
    public Result getUserInfo() {
        return Result.success("{\n" +
                "          name: '王立群',\n" +
                "          avatar:\n" +
                "            '//lf1-xgcdn-tos.pstatp.com/obj/vcloud/vadmin/start.8e0e4855ee346a46ccff8ff3e24db27b.png',\n" +
                "          email: 'wangliqun@email.com',\n" +
                "          job: 'frontend',\n" +
                "          jobName: '前端艺术家',\n" +
                "          organization: 'Frontend',\n" +
                "          organizationName: '前端',\n" +
                "          location: 'beijing',\n" +
                "          locationName: '北京',\n" +
                "          introduction: '人潇洒，性温存',\n" +
                "          personalWebsite: 'https://www.arco.design',\n" +
                "          phone: '150****0000',\n" +
                "          registrationDate: '2013-05-10 12:10:00',\n" +
                "          accountId: '15012312300',\n" +
                "          certification: 1,\n" +
                "          role,\n" +
                "        }");
    }

    @PostMapping("/login")
    public Result userLogin() {
        return Result.success("{token: 12345}");
    }

    @PostMapping("/logout")
    public Result userLogout() {
        return Result.success(null);
    }

    @PostMapping("/menu")
    public Result getMenu() {
        return Result.success("[\n" +
                "        {\n" +
                "          path: '/dashboard',\n" +
                "          name: 'dashboard',\n" +
                "          meta: {\n" +
                "            locale: 'menu.server.dashboard',\n" +
                "            requiresAuth: true,\n" +
                "            icon: 'icon-dashboard',\n" +
                "            order: 1,\n" +
                "          },\n" +
                "          children: [\n" +
                "            {\n" +
                "              path: 'workplace',\n" +
                "              name: 'Workplace',\n" +
                "              meta: {\n" +
                "                locale: 'menu.server.workplace',\n" +
                "                requiresAuth: true,\n" +
                "              },\n" +
                "            },\n" +
                "            {\n" +
                "              path: 'https://arco.design',\n" +
                "              name: 'arcoWebsite',\n" +
                "              meta: {\n" +
                "                locale: 'menu.arcoWebsite',\n" +
                "                requiresAuth: true,\n" +
                "              },\n" +
                "            },\n" +
                "          ],\n" +
                "        },\n" +
                "      ]");
    }


}
